Add a backwards linear function to be used with the fused mla q up-proj - #3330
Add a backwards linear function to be used with the fused mla q up-proj#3330chaseblock wants to merge 3 commits into
Conversation
Signed-off-by: Chase Block <cblock@nvidia.com>
Requires TE PR: NVIDIA/TransformerEngine#3330 Signed-off-by: Chase Block <cblock@nvidia.com>
for more information, see https://pre-commit.ci
Greptile SummaryThe PR adds a reusable linear-backward entry point for fused operations and exposes it through the fused MLA Q up-projection helper.
Confidence Score: 4/5The PR should not merge until the outstanding bias-gradient contract is fixed for callers that enable bias. The new wrapper allows Files Needing Attention: transformer_engine/pytorch/module/linear.py Important Files Changed
Reviews (2): Last reviewed commit: "Remove redundant import in backward_line..." | Re-trigger Greptile |
| wgrad, dgrad, _ = _linear_backward(bwd_args) | ||
| return dgrad, wgrad |
There was a problem hiding this comment.
When use_bias=True, _linear_backward computes a bias gradient, but this wrapper discards the third return value and exposes only dgrad and wgrad, preventing the caller from updating the bias parameter.
Knowledge Base Used: PyTorch Fused Modules (transformer_engine/pytorch/module)
Signed-off-by: Chase Block <cblock@nvidia.com>
Description
Please include a brief summary of the changes, relevant motivation and context.
Fixes # (issue)
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: